package com.burgeon.backend.SHOPBACKEND.controller;


import com.burgeon.backend.EnterpriseWeChat.service.EWEmpService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

@RequestMapping("backend/ew")
@RestController
@CrossOrigin
public class BackendEWXController extends BaseController {
    @Autowired
    private EWEmpService ewEmpService;

    @RequestMapping("incident/{token}")
    public ResponseResult<Void> getRecord(HttpServletRequest req, ServletResponse res, @PathVariable("token") String token){
        System.err.println(token);
        String CORP_ID = "ww6e5e29ebac488932"; //CorpId, 企业号的普通管理组中可查看eWechat.getCorpid()
        /*String SUITE_ID = "tja2312bedd5086xxx";    //套件ID，在套件信息中查看
        String SUITE_SECRET = "LGVT0BrN2DZ7VMTuIPOsudaWuXOE0iM67yHpIs1ofESS4l-jSC8LN9nOnmilhXXX";*/
        String SUITE_TOKEN = "omf3L1FW2FCVfp4yUQL1";//eWechat.getSuiteToken()
        String SUITE_ENCODING_AES_KEY = "tC9d9p9OPsqT9VQfeFadnPwOvPJ7mapNhXE8iPGTqgG";//eWechat.getEncodingAESKey()

        //获取参数
        String msgSignature = req.getParameter("msg_signature");
        String timestamp = req.getParameter("timestamp");
        String nonce = req.getParameter("nonce");
        String echostr = req.getParameter("echostr");    //创建套件时验证回调url时传入


        return new ResponseResult<>(SUCCESS);
    }

}
